package com.chenjiahao.kaiyanwan.ui.hot

import androidx.fragment.app.Fragment
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import com.chenjiahao.kaiyanwan.logic.dao.Repository
import com.hazz.kotlinmvp.mvp.model.bean.TabInfoBean

/**
 * Created by chenjh on 2020/9/18
 */
class HotTabViewModel: ViewModel() {
    private val getRankListLiveData=MutableLiveData<Any?>()

    var tabInfoList=ArrayList<TabInfoBean>()

    val mTabTitleList = ArrayList<String>()

    val mFragmentList = ArrayList<Fragment>()

    val RankListData=Transformations.switchMap(getRankListLiveData){
        Repository.getRankList()
    }

    fun requestRankListLiveData(){
        getRankListLiveData.value=getRankListLiveData.value
    }

}